<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@include file="/WEB-INF/public/head.jsp" %>
<style>
    .ui-icon-seek-next::before{
        content:">";
    }
    .ui-icon-seek-prev::before{
        content:"<";
    }
    .ui-icon-seek-first::before{
        content:"<<";
    }
    .ui-icon-seek-end::before{
        content:">>";
    }
</style>

<%@include file="/WEB-INF/public/nav.jsp" %>

<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>


        <div class="sidebar" id="sidebar">
            <script type="text/javascript">
                try {
                    ace.settings.check('sidebar', 'fixed')
                } catch (e) {
                }
            </script>
            <style>
                .all{
                    height:38px;
                    display: flex;
                    background:#82AF6F;
                }
                .all>span{
                    flex:3;
                    display:block;
                    height:38px;
                    line-height:38px;
                    color:white;
                    text-align:center;
                }
                .all>a{
                    flex:1;
                    display:block;
                    height:38px;
                    line-height:38px;
                    text-align:center;
                    color:white;
                    border-left:2px solid #fff;
                }

            </style>
            <div class="all">
                <span>服务县市区</span>
                <a href="">全部</a>
            </div>
            <ul class="nav nav-list">

                <c:forEach items="${sq}" var="sq" >
                    <li>
                        <a class="dropdown-toggle">
                            <i class="icon-cog"></i>
                            <span class="menu-text"> ${sq.fwsq}(${sq.sqbmzs}) </span>
                            <b class="arrow icon-angle-down"></b>
                        </a>
                        <ul class="submenu">
                            <c:set var="fwsq" scope="session" value="${sq.fwsq}"/>
                            <c:forEach items="${qx}" var="qx" >
                                <c:if test="${qx.fwsq == fwsq}">
                                    <li>
                                        <a href="${pageContext.request.contextPath}">
                                            <i></i>
                                            <span class="menu-text">${qx.fwxq}(${qx.xqbmrs})</span>
                                        </a>
                                    </li>
                                </c:if>
                            </c:forEach>
                        </ul>
                    </li>
                </c:forEach>
            </ul><!-- /.nav-list -->

            <div class="sidebar-collapse" id="sidebar-collapse">
                <i class="icon-double-angle-left" data-icon1="icon-double-angle-left"
                   data-icon2="icon-double-angle-right"></i>
            </div>

            <script type="text/javascript">
                try {
                    ace.settings.check('sidebar', 'collapsed')
                } catch (e) {
                }
            </script>
        </div>

        <div class="main-content">
            <%@include file="/WEB-INF/public/breadcrumb.jsp" %>

            <div class="page-content">
                <div class="row">
                    <div class="cf col-xs-12 col-lg-6">
                        <a class="btn btn-danger btn-sm" href="{:U('delall')}" onClick="return confirm('确定数据初始化么?');">数据初始化</a>
                        <a class="btn btn-danger btn-sm" onClick="dzgl.addbscj('bscj')">导入笔试成绩</a>
                        <a class="btn btn-danger btn-sm" onClick="dzgl.addmscj('mscj')">导入面试成绩</a>
                        <a class="btn btn-danger btn-sm" href="">一键核算</a>
                        <a class="btn btn-danger btn-sm" href="">一键录取</a>
                        <a class="btn btn-success btn-sm" href="">录取结果</a>
                        <a class="btn btn-success btn-sm" target="_blank" href="/single/exportExcel">导出excel</a>
                    </div>
                    <div class="input-group col-xs-10 col-lg-5">
                        <form class="form-inline">
                            <div class="form-group">
                                <input type="text" id="txtQuery" class="form-control" placeholder="请输入关键字" name='val' style="width: 400px">
                            </div>
                            <button type="button" class="btn btn-info btn-sm" id="btnSearch">查询</button>
                        </form>
                    </div>

                    <table id="grid-table" style="background: #fff;"></table>

                    <div id="grid-pager"></div>

                    <div class="showInfo"></div>
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div><!-- /.main-content -->

    </div><!-- /.main-container-inner -->

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="icon-double-angle-up icon-only bigger-110"></i>
    </a>




</div>
<!-- /.main-container -->
<%@include file="/WEB-INF/public/footerjs.jsp" %>
<script src="/ace/js/jqGrid/i18n/grid.locale-cn.js"></script>
<script src="/ace/js/jqGrid/jquery.jqGrid.min.js"></script>
<script>
    var $jqGrid=$('#grid-table'),$pager=$('#grid-pager');
    $jqGrid.jqGrid({
        url:"${pageContext.request.contextPath}/single/getData",
        datatype:'json',
        mttype:'post',
        colNames:['录取状态','考生号','姓名','身份证号','语文成绩','数学成绩','外语成绩','面试成绩','政策加分','总成绩','地域排名','服务县区','志愿','操作'],
//        colNames:['考生号','姓名','身份证号'],
        colModel:[
            {name:'lqzt',index:'lqzt',width:'100',align:'center',formatter:function(cellvalue,options,rowObject){
                var res='';
                switch(cellvalue){
                    case '0':
                        res='初始化';
                        break;
                    case '1':
                        res='笔试成绩导入';
                        break;
                }
                return res;
            }},
            {name:'ksh',index:'ksh',width:'100',align:'center'},
            {name:'xm',index:'xm',width:'100',align:'center'},
            {name:'sfzh',index:'sfzh',width:'100',align:'center'},
            {name:'ywcj',index:'ywcj',width:'100',align:'center'},
            {name:'sxcj',index:'sxcj',width:'100',align:'center'},
            {name:'wycj',index:'wycj',width:'100',align:'center'},
            {name:'mscj',index:'mscj',width:'100',align:'center'},
            {name:'zcjf',index:'zcjf',width:'100',align:'center'},
            {name:'zcj',index:'zcj',width:'100',align:'center'},
            {name:'fdqpm',index:'fdqpm',width:'100',align:'center'},
            {name:'fwxq1',index:'fwxq1',width:'100',align:'center'},
            {name:'kszy1',index:'kszy1',width:'100',align:'center'},
            {name:'ksh',index:'ksh',width:'100',align:'center',formatter:function(cellvalue,options,rowObject){
                return '<a class="btn btn-info btn-xs" onclick="dzgl.viewDetail(\''+cellvalue+'\')">查看详情</a>';
            }}
        ],
        height:'auto',
        pager: '#grid-pager',
        viewrecords:true,
        rowNum:10,
        rowList:[10,20,30],
        autowidth:true

    });

    $('#btnSearch').click(function(){
        var q=$('#txtQuery').val();
        $jqGrid.jqGrid('setGridParam',{
            postData:{q:q},
            page:1
        }).trigger("reloadGrid");
    });


    dzgl={
        viewDetail:function(ksh){
            $.post("/single/detail",{ksh:ksh},function(data){
                console.log(data);
                $('.showInfo').html(data);
                $('#ModalInfo').modal();
            },'html');
        },
        addbscj:function(flag){
            $.post("/single/addbscj",{},function(data){
                $('.showInfo').html(data);
                $('#myModal').modal();

            },'html');

            $('#myModal').modal();
        }
    }
</script>
<%@include file="/WEB-INF/public/foot.jsp" %>
